/**
 * 客观题与主观题的api接口
 */

import request from '@/utils/request'

// 查询题目列表
export function listQuestion(query) {
    return request({
        url: '/question/question/list',
        method: 'get',
        params: query
    })
}

// 查询客观题库详细
export function getQuestion(query) {
    return request({
        url: '/question/question/',
        method: 'get',
        params: query
    })
}

// 新增客观题目
export function addObjective(obj) {
    return request({
        url: '/question/question/addObj',
        method: 'post',
        data: obj
    })
}

// 新增主观题目
export function addSubjective(sub) {
    return request({
        url: '/question/question/addSub',
        method: 'post',
        data: sub
    })
}

// 修改客观题目
export function updateObjective(obj) {
    return request({
        url: '/question/question/editObj',
        method: 'put',
        data: obj
    })
}

// 修改主观题目
export function updateSubjective(sub) {
    return request({
        url: '/question/question/editSub',
        method: 'put',
        data: sub
    })
}

// 删除题目
export function delQuesion(query) {
    return request({
        url: '/question/question/',
        method: 'delete',
        params: query
    })
}
